
<script setup lang="ts">
  import { PropType } from "#imports"

  const router = useRouter()

  const props = defineProps<{
    nav: WebGLCardProps
  }>()

// const props = withDefaults(defineProps<WebGLCardProps>(), {
//   hash: 'default',
//   name: '',
//   route: ''
// })

  const go = (path: string) => {
    router.push({
      path: path
    })
  }

</script>

<template>
  <div class="webgl_card_container" :style="{ background: props.nav.background }" @click="go(props.nav.route)">
    <div class="text">{{ props.nav.name }}</div>
  </div>
</template>

<style lang="scss" scoped>
.webgl_card_container {
  width: 240px;
  height: 120px;
  padding: 0 40px;
  margin: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  cursor: pointer;
  &:hover {
    .text {
      transform: scale(1.1);
    }
  }
}
</style>